﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using NavKet.Models;

namespace NavKet.Controllers
{
    public class MallController : Controller
    {

        //
        // GET: /mall/
        MallEntities1 navKetEntity = new MallEntities1();
        public ActionResult Index(int id)
        {
            Mall  mallList = navKetEntity.SelectMallByMallId(id).SingleOrDefault();
            //floors
         
            List<Floor> floorList = navKetEntity.SelectFloorByMallId(id).ToList();
            
            ViewBag.MallName = mallList.name;
            ViewBag.MallId = mallList.id;
            //mall images 
            //List<string> mallImagesList = navKetEntity.SelectMallImagesByMallId( id ).Select( x => x.ImageName ).ToList();
            ViewBag.FloorList = floorList;
            return View(mallList);
        }

    }
}
